package com.fr.chart.axis;

import com.fr.base.core.json.JSONException;
import com.fr.base.core.json.JSONObject;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.chart.DataSeriesCondition;
import com.fr.util.Utils;

public class SeriesAttrMarkerType
  implements DataSeriesCondition
{
  private static final long serialVersionUID = -615959191709175386L;
  public static final String XML_TAG = "SeriesAttrMarkerType";
  private int markerTypeIndex = 0;

  public SeriesAttrMarkerType()
  {
  }

  public SeriesAttrMarkerType(int paramInt)
  {
    this.markerTypeIndex = paramInt;
  }

  public void setMarekerTypeIndex(int paramInt)
  {
    this.markerTypeIndex = paramInt;
  }

  public int getMarkerTypeIndex()
  {
    return this.markerTypeIndex;
  }

  public String getConditionType()
  {
    return "SeriesAttrMarkerType";
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof SeriesAttrMarkerType))
      return false;
    SeriesAttrMarkerType localSeriesAttrMarkerType = (SeriesAttrMarkerType)paramObject;
    return (localSeriesAttrMarkerType.markerTypeIndex == this.markerTypeIndex);
  }

  public JSONObject toJSONObject()
    throws JSONException
  {
    JSONObject localJSONObject = new JSONObject();
    localJSONObject.put("markerTypeIndex", this.markerTypeIndex);
    return localJSONObject;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if (paramXMLableReader.isChildNode())
    {
      String str1 = paramXMLableReader.getTagName();
      if (str1.equals("Attr"))
      {
        String str2;
        if ((str2 = paramXMLableReader.getAttr("markerTypeIndex")) != null)
          setMarekerTypeIndex(Utils.string2Number(str2).intValue());
      }
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("SeriesAttrMarkerType");
    paramXMLPrintWriter.startTAG("Attr").attr("markerTypeIndex", this.markerTypeIndex).end();
    paramXMLPrintWriter.end();
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }
}